const mysql = require('mysql');

const connection = mysql.createConnection({      //创建mysql实例
  host: '127.0.0.1',
  port: '3306',
  user: 'root',
  password: 'root',
  database: 'admin_xs'
});

connection.connect(function (err) {
  if(err){
    console.log('数据库连接失败')
    return;
  }
  console.log('数据库连接成功')
})

module.exports = connection